package jcf;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class CollectionTest {
    public static void main(String[] args) {
        Collection<Integer> collection=new ArrayList<>();
        collection.add(1);
        collection.add(3);
        collection.add(5);//默认尾插
        System.out.println(collection.size());
        System.out.println(collection.remove(3));
        System.out.println(collection.size());
        Object[] array=collection.toArray();
        System.out.println(Arrays.toString(array));
//        collection.clear();
//        System.out.println(collection.isEmpty());
        //遍历集合
        for(Integer i:collection){
            System.out.print(i+"、");
        }
    }
}
